package com.wiscamp.ninechapters.problems.math;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 边的表示
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class LatexEdgeDenote extends LatexGeometryDenote {
    /**
     * 起始顶点
     */
    private char startVertex;

    /**
     * 结束顶点
     */
    private char endVertex;


    public String getLatex() {
        String temp = String.valueOf(startVertex) + endVertex;
        return temp.toUpperCase();
    }

    public LatexEdgeDenote(char startVertex, char endVertex) {
        this.startVertex = startVertex;
        this.endVertex = endVertex;
    }

    public LatexEdgeDenote(String content) {
        if (content.length() == 2) {
            var array = content.toCharArray();
            this.startVertex = array[0];
            this.endVertex = array[1];
        }
    }
}
